package com.ys.day30.p5json解析;

import java.util.Objects;

/**
 * 描述:
 *
 * @author CodeYang
 * @version 2021/1/15 0:51
 */
public class Worker{
    private int id;
    private String workerName;
    private  int workerSalary;

    public Worker() {
    }

    public Worker(int id, String workerName, int workerSalary) {
        this.id = id;
        this.workerName = workerName;
        this.workerSalary = workerSalary;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getWorkerName() {
        return workerName;
    }

    public void setWorkerName(String workerName) {
        this.workerName = workerName;
    }

    public int getWorkerSalary() {
        return workerSalary;
    }

    public void setWorkerSalary(int workerSalary) {
        this.workerSalary = workerSalary;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Worker worker = (Worker) o;
        return id == worker.id &&
                workerSalary == worker.workerSalary &&
                Objects.equals(workerName, worker.workerName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, workerName, workerSalary);
    }

    @Override
    public String toString() {
        return "Worker{" +
                "id=" + id +
                ", workerName='" + workerName + '\'' +
                ", workerSalary=" + workerSalary +
                '}';
    }
}
